package com.qfjy.wangzeyu;

/**
 * <h>
 *
 * @Author: Wyzel
 * @Date: 13/9/2022 下午7:09
 * @Version: 0.1
 */
public class CustomerFactory {

    public static final String[] names = {"Rob", "Joe", "Julie"};

    public static AbstractCustomer getCustomer(String name){
        for (int i = 0; i < names.length; i++) {
            if (names[i].equalsIgnoreCase(name)){
                return new RealCustomer(name);
            }
        }
        return new NullCustomer();
    }
}
